package com.chenwc.wso2.wso2esb;

import java.io.File;

/**
 * wso2相关属性
 * @author chenwc
 * @date 2023/8/31 22:09
 */
public class Wso2Properties {

    private final File file = new File("1.txt");
    private String saveFilePath = file.getAbsolutePath().replace("1.txt", "") + "saveFile\\";

    private String wso2Host = "https://192.168.100.129:9443";

    //获取X-CSRF-Token
    private String getTokenUrl = this.wso2Host + "/carbon/admin/js/csrfPrevention.js";

    //登录
    private String loginUrl = this.wso2Host + "/carbon/admin/login_action.jsp";

    //传工件
    private String uploadCarFileUrl = this.wso2Host + "/fileupload/carbonapp";

    //删除工件
    private String deleteCarFileUrl = this.wso2Host + "/carbon/carbonapps/delete_artifact_ajaxprocessor.jsp";

    //下载工件
    private String downloadCarFileUrl = this.wso2Host + "/carbon/carbonapps/download-ajaxprocessor.jsp";

    //获取工件列表
    private String getCarFileListUrl = this.wso2Host + "/carbon/carbonapps/index.jsp";

    //退出登录
    private String logoutUrl = this.wso2Host + "/carbon/admin/jsp/session-validate.jsp";

    private String username;
    private String password;

    public void setWso2Host(String wso2Host) {
        this.getTokenUrl = this.getTokenUrl.replace(this.wso2Host, wso2Host);
        this.loginUrl = this.loginUrl.replace(this.wso2Host, wso2Host);
        this.uploadCarFileUrl = this.uploadCarFileUrl.replace(this.wso2Host, wso2Host);
        this.deleteCarFileUrl = this.deleteCarFileUrl.replace(this.wso2Host, wso2Host);
        this.downloadCarFileUrl = this.downloadCarFileUrl.replace(this.wso2Host, wso2Host);
        this.getCarFileListUrl = this.getCarFileListUrl.replace(this.wso2Host, wso2Host);
        this.logoutUrl = this.logoutUrl.replace(this.wso2Host, wso2Host);
        this.wso2Host = wso2Host;
    }

    public void setGetTokenUrl(String getTokenUrl) {
        this.getTokenUrl = getTokenUrl;
    }

    public void setLoginUrl(String loginUrl) {
        this.loginUrl = loginUrl;
    }

    public void setUploadCarFileUrl(String uploadCarFileUrl) {
        this.uploadCarFileUrl = uploadCarFileUrl;
    }

    public void setDeleteCarFileUrl(String deleteCarFileUrl) {
        this.deleteCarFileUrl = deleteCarFileUrl;
    }

    public void setDownloadCarFileUrl(String downloadCarFileUrl) {
        this.downloadCarFileUrl = downloadCarFileUrl;
    }

    public void setGetCarFileListUrl(String getCarFileListUrl) {
        this.getCarFileListUrl = getCarFileListUrl;
    }

    public void setLogoutUrl(String logoutUrl) {
        this.logoutUrl = logoutUrl;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setSaveFilePath(String saveFilePath) {
        this.saveFilePath = saveFilePath;
    }

    public String getDownloadCarFileUrl() {
        return downloadCarFileUrl;
    }

    public String getSaveFilePath() {
        return saveFilePath;
    }

    public String getWso2Host() {
        return wso2Host;
    }

    public String getGetTokenUrl() {
        return getTokenUrl;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public String getUploadCarFileUrl() {
        return uploadCarFileUrl;
    }

    public String getDeleteCarFileUrl() {
        return deleteCarFileUrl;
    }

    public String getGetCarFileListUrl() {
        return getCarFileListUrl;
    }

    public String getLogoutUrl() {
        return logoutUrl;
    }
}
